---
title: "Analysis"
author: "Kaylyn Jackson Schiff, Daniel Schiff, and Natalia Bueno"
date: "2020"
output: pdf_document
editor_options: 
  chunk_output_type: console
---

#####Setup Chunk#####
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(rmarkdown)
library(tidyverse)
library(gridExtra)
library(xtable)
library(stargazer)
library(estimatr)
library(regrrr)
library(dotwhisker)
library(interplot)
library(sandwich)
library(ggpubr)
library(meta)
library(RColorBrewer)
library(rstatix)
options(scipen=999)

base_dir <- getwd()
```

##### The code here was not used for any main or sm analyses, but an option for people who are interested in reproducing figures and tables for an alternative coding of respondent race/ethnicity and use of pre-treatment partisanship (it serves as a robustness check, and, again, produces no figures or tables used in the manuscript or SM)

#####Alternative Race Coding
#####Read in the Clean Data
```{r read in data}
ld1 <- readRDS("data/df_clean.rds")
ld2 <- readRDS("data/df_followup_clean.rds")
ld3 <- readRDS("data/df_followup2_clean.rds")

#Code race as pre-registered
ld1$race <- as.character(ld1$race)
ld1$race <- if_else(ld1$race %in% c("Hispanic", "Asian"), "Other", ld1$race)
ld1$race <- factor(ld1$race, levels = c("White", "Black", "Other"), 
                  labels = c("White", "Black", "Other"), ordered = FALSE)

ld2$race <- as.character(ld2$race)
ld2$race <- if_else(ld2$race %in% c("Hispanic", "Asian"), "Other", ld2$race)
ld2$race <- factor(ld2$race, levels = c("White", "Black", "Other"), 
                  labels = c("White", "Black", "Other"), ordered = FALSE)

ld3$race <- as.character(ld3$race)
ld3$race <- if_else(ld3$race %in% c("Hispanic", "Asian"), "Other", ld3$race)
ld3$race <- factor(ld3$race, levels = c("White", "Black", "Other"), 
                  labels = c("White", "Black", "Other"), ordered = FALSE)
```


####Figure 1: Study 1 Design
No code required, visual representation of Study 1 randomization, treatments, and outcomes


####Figure 2: Liar's Dividend Results for Study 1
```{r}
ld1$treatment <- if_else(ld1$alleg_treatment == "Info. Uncertain" | ld1$alleg_treatment == "Opp. Rally", 1, 0)

#Figure
ld_support <- lm_robust(data = ld1, 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
ld_support

mechs_support <- lm_robust(data = ld1, 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
mechs_support

ld_support_text <- lm_robust(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
ld_support_text

mechs_support_text <- lm_robust(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
mechs_support_text

ld_support_video <- lm_robust(data = ld1 %>% filter(media_format == "Video"), 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
ld_support_video

mechs_support_video <- lm_robust(data = ld1 %>% filter(media_format == "Video"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
mechs_support_video

study_1_support <- rbind(ld_support[2,], ld_support_text[2,], ld_support_video[2,], mechs_support[2,], mechs_support_text[2,], mechs_support_video[2,], mechs_support[3,], mechs_support_text[3,], mechs_support_video[3,])
study_1_support
study_1_support$model <- rep(c("Text and Video", "Text Only", "Video Only"), 3)
study_1_support$term <- rep(c("Allegation", "Info. Uncertain", "Opp. Rally"), each = 3)


study_1_support_plot <- dwplot(study_1_support %>% arrange(model),
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2),
dot_args = list(aes(shape = model), size = 1.5)) +
#whisker_args = list(color = "blue"))  +
scale_color_discrete(name = "Media Format", labels = c("Text and Video", "Text Only", "Video Only") %>% rev(), 
                      breaks=c("Text and Video", "Text Only", "Video Only") %>% rev()) +
 scale_shape_discrete(name = "Media Format", labels = c("Text and Video", "Text Only", "Video Only"), 
                      breaks=c("Text and Video", "Text Only", "Video Only")) +
    xlab("\nTreatment Effect (Standardized)") + ylab("") + ggtitle("Effects on Politician Support Index") +
    xlim(-.3, .3) +
    theme_bw() + 
    theme(plot.title = element_text(face="bold"),
          legend.position = "right",
          legend.background = element_rect(colour="grey80")
          )
study_1_support_plot

#Table
m1 <- lm(data = ld1, 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m2 <- lm(data = ld1, 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) 
m3 <- lm(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) 
m4 <- lm(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m5 <- lm(data = ld1 %>% filter(media_format == "Video"), 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m6 <- lm(data = ld1 %>% filter(media_format == "Video"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)

stargazer(m1, m2, m3, m4, m5, m6,
          se = starprep(m1, m2, m3, m4, m5, m6),
          covariate.labels=c("Allegation", "Info. Uncertain", "Opp. Rally", 
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican", 
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels = "Politician Support Index",
          keep.stat = c("n","rsq"),
          title="Figure 2 Regression Results",
          label="tab:fig_2",
          star.char = c("+","*","**","***"), 
          star.cutoffs = c(0.1,0.05,0.01,0.001), 
          notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
          notes.append = F,
          add.lines = list(c("Sample", "Study 1", "Study 1", "Study 1 Text", "Study 1 Text", "Study 1 Video", "Study 1 Video")),
          style="APSR",
          header=F,
          type="latex",
          font.size="scriptsize")

```


####Figure 3: Liar's Dividend Results for Study 2
```{r}
#Figure
mechs_support_text <- lm_robust(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
mechs_support_text

IU_support <- lm_robust(data = ld2, 
                   support_exp1 ~ alleg_treatment_1 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
IU_support

ates <- c(mechs_support_text[2,2], IU_support[2,2]) %>% unlist %>% unname
ses <- c(mechs_support_text[2,3], IU_support[2,3]) %>% unlist %>% unname
ns <- c(nrow(ld1), nrow(ld2))
support_IU <- cbind(ates, ses, ns) %>% as_tibble()
support_IU_meta <- metagen(data = support_IU, TE = ates, seTE = ses, n.e = ns)
pooled_support_IU <- c("Pooled IU", support_IU_meta$TE.fixed, support_IU_meta$seTE.fixed, support_IU_meta$statistic.fixed, support_IU_meta$pval.fixed, support_IU_meta$TE.fixed - 1.96*support_IU_meta$seTE.fixed,
                       support_IU_meta$TE.fixed + 1.96*support_IU_meta$seTE.fixed)


OR_support <- lm_robust(data = ld2, 
                   support_exp2 ~ alleg_treatment_2 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
OR_support

ates <- c(mechs_support_text[3,2], OR_support[2,2]) %>% unlist %>% unname
ses <- c(mechs_support_text[3,3], OR_support[2,3]) %>% unlist %>% unname
ns <- c(nrow(ld1), nrow(ld2))
support_OR <- cbind(ates, ses, ns) %>% as_tibble()
support_OR_meta <- metagen(data = support_OR, TE = ates, seTE = ses, n.e = ns)
pooled_support_OR <- c("Pooled OR", support_OR_meta$TE.fixed, support_OR_meta$seTE.fixed, support_OR_meta$statistic.fixed, support_OR_meta$pval.fixed, support_OR_meta$TE.fixed - 1.96*support_OR_meta$seTE.fixed,
                       support_OR_meta$TE.fixed + 1.96*support_OR_meta$seTE.fixed)


study_2_support <- rbind(mechs_support_text[2,], IU_support[2,], pooled_support_IU, 
                         mechs_support_text[3,], OR_support[2,], pooled_support_OR)
study_2_support[,-1] <- sapply(study_2_support[,-1], as.numeric)
study_2_support
study_2_support$model <- factor(rep(c("Study 1", "Study 2", "Pooled"), 2), levels = c("Study 1", "Study 2", "Pooled"))
study_2_support$term <- rep(c("Info. Uncertain", "Opp. Rally"), each = 3)


study_2_support_plot <- dwplot(study_2_support %>% arrange(model),
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2),
dot_args = list(aes(shape = model, color = model), size = 1.5)) +
#whisker_args = list(color = "blue"))  +
scale_color_manual(name = "Study", labels = c("Study 1", "Study 2", "Pooled") %>% rev(),
                   breaks=c("Study 1", "Study 2", "Pooled") %>% rev(), 
                   values = c("#7570B3", "#D95F02", "#1B9E77")) + 
 scale_shape_discrete(name = "Study", labels=c("Study 1", "Study 2", "Pooled"),
                      breaks=c("Study 1", "Study 2", "Pooled")) +
    xlab("\nTreatment Effect (Standardized)") + ylab("") + ggtitle("Effects on Politician Support Index") +
    xlim(-.3, .3) +
    theme_bw() + 
    theme(plot.title = element_text(face="bold"),
          legend.position = "right",
          legend.background = element_rect(colour="grey80")
          )
study_2_support_plot


#Table
m1 <- lm(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m2 <- lm(data = ld2, 
                   support_exp1 ~ alleg_treatment_1 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m3 <- lm(data = ld2, 
                   support_exp2 ~ alleg_treatment_2 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)

stargazer(m1, m2, m3,
          se = starprep(m1, m2, m3),
          omit = c("Fact Check"),
          covariate.labels=c("Info. Uncertain", "Opp. Rally", "Info. Uncertain", "Opp. Rally",
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican",
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels.include = F,
          column.labels = c("Politician Support Index"),
          column.separate = c(3),
          keep.stat = c("n","rsq"),
          title="Figure 3 Regression Results",
          label="tab:fig_3",
          font.size="scriptsize",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
				  add.lines = list(c("Sample", "Study 1 Text", "Study 2", "Study 2")),
          style="APSR",
          header=F,
          type="latex")

```


####Figure 4: Heterogeneous Effects of Oppositional Rallying and Informational Uncertainty
```{r}
#IU pooled
ld3_IU <- ld1 %>% filter(alleg_treatment != "Opp. Rally") %>% 
  mutate(wave = 1) %>% 
  dplyr::select(support, belief, trust, belief_1,
                media_format, wave, alleg_treatment, partisan,
                party, gender, race, age, education, income, region, media_literacy, digital_literacy) %>% 
  rbind(
    ld2 %>% filter(alleg_treatment_1 != "Fact Check") %>% 
      mutate(media_format = "Text") %>% 
        mutate(wave = 2) %>% 
      dplyr::select(support = support_exp1, belief = belief_exp1, trust = trust_exp1, belief_1,
                    media_format, wave, alleg_treatment = alleg_treatment_1, partisan = partisan_1,
                    party, gender, race, age, education, income, region, media_literacy, digital_literacy))

#OR pooled
ld3_OR <- ld1 %>% filter(alleg_treatment != "Info. Uncertain") %>% 
  mutate(wave = 1) %>% 
  dplyr::select(support, #belief, trust,
                media_format, wave, alleg_treatment, partisan,
                party, gender, race, age, education, income, region, media_literacy, digital_literacy) %>% 
  rbind(
    ld2 %>% 
      mutate(media_format = "Text") %>% 
        mutate(wave = 2) %>% 
      dplyr::select(support = support_exp2, #belief = belief_exp1, trust = trust_exp1,
                    media_format, wave, alleg_treatment = alleg_treatment_2, partisan = partisan_2,
                    party, gender, race, age, education, income, region, media_literacy, digital_literacy))

#Interact with co-partisan variable
iu_anti <- lm_robust(data = ld3_IU %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=1) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_anti <- iu_anti[2,]

or_anti <- lm_robust(data = ld3_OR %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=1) + wave +
                        gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
or_anti <- or_anti[2,]

iu_mod <- lm_robust(data = ld3_IU %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=2) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_mod <- iu_mod[2,]

or_mod <- lm_robust(data = ld3_OR %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=2) + wave +
                        gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
or_mod <- or_mod[2,]

iu_co <- lm_robust(data = ld3_IU %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=3) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_co <- iu_co[2,]

or_co <- lm_robust(data = ld3_OR %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=3) + wave +
                        gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
or_co <- or_co[2,]

co_data <- rbind(iu_co, or_co, iu_mod, or_mod, iu_anti, or_anti)
co_data$model <- c("Co-partisan", "Co-partisan", "Independent", "Independent", "Out-partisan", "Out-partisan")
co_data$model <- factor(co_data$model, levels = c("Out-partisan","Independent","Co-partisan"))
co_data$term <- rep(c("Info. Uncertain", "Opp. Rally"), 3)

#Create coefficient plot for heterogeneous effects by partisanship
co_plot <- dwplot(co_data %>% arrange(desc(model)),
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2),
dot_args = list(size = 3, aes(color = model, shape = model)),
whisker_args = list(aes(color = model)))  +
  labs(color = "Partisanship", shape = "Partisanship") +
  guides(color = guide_legend(reverse = T), shape = guide_legend(reverse = T)) +
    xlab("\nTreatment Effect (Standardized)") + ylab("") + ggtitle("Effects on Politician Support Index by Co-partisanship") +
    xlim(-.25, .4) +
    theme_bw() + 
    theme(plot.title = element_text(face="bold"),
          legend.background = element_rect(colour="grey80"),
          axis.title.x = element_text(size = 11), axis.text.y = element_text(size = 9),
          legend.text = element_text(size = 10), legend.title = element_text(size = 10)
          )
co_plot

#Table
IU_fig4 <- lm(data = ld3_IU %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=2) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy)
OR_fig4 <- lm(data = ld3_OR %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=2) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy)

stargazer(IU_fig4, OR_fig4,
          se = starprep(IU_fig4, OR_fig4),
          covariate.labels=c("Info. Uncertain", "Opp. Rally", "Anti-partisan", "Co-partisan",
                             "Wave",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Info. Uncertain x Anti-partisan", "Info. Uncertain x Co-partisan",
                             "Opp. Rally x Anti-partisan", "Opp. Rally x Co-partisan",
                             "Constant"),
          dep.var.labels = "Politician Support Index",
          keep.stat = c("n","rsq"),
          title="Figure 4 Regression Results",
          label="tab:fig_4",
          font.size="scriptsize",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
				  add.lines = list(c("Sample", "Studies 1 and 2", "Studies 1 and 2")),
          style="APSR",
          header=F,
          type="latex")
```


####Table 1: Impacts on Trust in Media
```{r}
ld_trust_text <- lm(data = ld1 %>% filter(media_format == "Text"), 
                   trust ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
ld_trust_text

IU_trust <- lm(data = ld2, 
                   trust_exp1 ~ alleg_treatment_1 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
IU_trust


#Create regression table
stargazer(ld_trust_text, IU_trust, 
          se = starprep(ld_trust_text, IU_trust),
          keep = c("\\btreatment\\b", "alleg_treatment_1Info. Uncertain"),
          covariate.labels=c("Allegation", "Info. Uncertainty"),
          dep.var.labels.include = F,
				  column.labels = c("Trust in Media Index"),
          column.separate = c(2),
          keep.stat = c("n","rsq"),
          title="Impacts on Trust in Media",
          label="tab:trust_table",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 1 Text", "Study 2")),
          header=F,
          type="latex")

#Create full regression table
stargazer(ld_trust_text, IU_trust, 
          se = starprep(ld_trust_text, IU_trust),
          omit = c("Fact Check"),
          covariate.labels=c("Allegation", "Info. Uncertain",
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican",
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels.include = F,
          column.labels = c("Trust in Media Index"),
          column.separate = c(2),
          keep.stat = c("n","rsq"),
          title="Table 1 Full Regression Results",
          label="tab:table_1",
          font.size = "scriptsize",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 1 Text", "Study 2")),
          header=F,
          type="latex")
          
```


####Figure 5: Liar's Dividend Results for Study 3
```{r fig 5}
iu_v_denial <- lm_robust(data = ld3,
                   support ~ relevel(alleg_treatment, ref="Simple Denial") +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_v_denial <- iu_v_denial[2,]

iu_v_apology <- lm_robust(data = ld3,
                   support ~ relevel(alleg_treatment, ref="Apology") +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_v_apology <- iu_v_apology[2,]

data <- rbind(iu_v_denial, iu_v_apology)
data$term <- c("Allegation of Misinformation \n (Info. Uncertain) \n vs. Denial", "Allegation of Misinformation \n (Info. Uncertain) \n vs. Apology")
data$term <- factor(data$term, levels = c("Allegation of Misinformation \n (Info. Uncertain) \n vs. Denial", "Allegation of Misinformation \n (Info. Uncertain) \n vs. Apology"))

#Create coefficient plot
followup_2_plot <- dwplot(data %>% arrange(desc(term)),
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2),
dot_args = list(size = 3, color = "blue"),
whisker_args = list(color = "blue"))  +
#scale_color_discrete(name = "Outcome", breaks=c("Feeling", "Trust", "Quality", "Impact")) +
 # scale_shape_discrete(name = "Outcome", breaks=c("Feeling", "Trust", "Quality", "Impact")) +
    xlab("\nTreatment Effect (Standardized)") + ylab("") + ggtitle("Effects on Politician Support Index") +
    xlim(-.3, .3) +
    theme_bw() + 
    theme(plot.title = element_text(face="bold"),
          legend.position = "none",
          legend.background = element_rect(colour="grey80"),
            axis.text = element_text(size = 12)
          )
followup_2_plot

#Table
iu_v_other <- lm(data = ld3,
                   support ~ relevel(alleg_treatment, ref="Info. Uncertain") +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
stargazer(iu_v_other, 
          se = starprep(iu_v_other),
          covariate.labels=c("Denial vs. IU", "Apology vs. IU",
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican",
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels = "Politician Support Index",
          keep.stat = c("n","rsq"),
          title="Figure 5 Regression Results",
          label="tab:fig_5",
          font.size="scriptsize",
				  star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 3")),
          header=F,
          type="latex")
```


####Table 2: Allegations of Misinformation Versus Apologies
```{r table 2}
#IU versus apology
ld3$alleg_treatment_3 <- factor(ld3$alleg_treatment, levels = c("Apology","Info. Uncertain", "Simple Denial"))

#Do the allegation treatments affect politician support?
hyp_1_combined_support <- lm(data = ld3 %>% filter(alleg_treatment_3 != "Simple Denial"), 
                             support ~ alleg_treatment_3 +
                               party + gender + race + age + education + income + region + media_literacy + digital_literacy)
hyp_1_combined_support %>% summary


#Do the allegation treatments affect belief in the story?
hyp_1_combined_belief <- lm(data = ld3 %>% filter(alleg_treatment_3 != "Simple Denial"), 
                             belief ~ alleg_treatment_3 +
                              party + gender + race + age + education + income + region + media_literacy + digital_literacy)
hyp_1_combined_belief %>% summary


#Do the allegation treatments affect trust in media?
hyp_1_combined_trust <- lm(data = ld3 %>% filter(alleg_treatment_3 != "Simple Denial"), 
                             trust ~ alleg_treatment_3 +
                             party + gender + race + age + education + income + region + media_literacy + digital_literacy)
hyp_1_combined_trust %>% summary

#Create regression table
stargazer(hyp_1_combined_support, hyp_1_combined_belief, hyp_1_combined_trust, 
          se = starprep(hyp_1_combined_support, hyp_1_combined_belief, hyp_1_combined_trust),
          keep = c("alleg_treatment_3Info. Uncertain"),
          covariate.labels=c("Info. Uncertain"),
          dep.var.labels = c("Support Index", "Belief Index", "Trust Index"),
          keep.stat = c("n","rsq"),
          title="Allegations of Misinformation versus Apologies",
          label="tab:combined",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
          notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 3", "Study 3", "Study 3")),
          header=F,
          type="latex")

#Create full regression table
stargazer(hyp_1_combined_support, hyp_1_combined_belief, hyp_1_combined_trust, 
          se = starprep(hyp_1_combined_support, hyp_1_combined_belief, hyp_1_combined_trust),
          covariate.labels=c("Info. Uncertain",
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican",
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels = c("Support Index", "Belief Index", "Trust Index"),
          keep.stat = c("n","rsq"),
          title="Table 2 Full Regression Results",
          label="tab:table_2",
          font.size="scriptsize",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
          notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 3", "Study 3", "Study 3")),
          header=F,
          type="latex")
```


#####Use of Pre-Treatment Partisanship
#####Read in the Clean Data
```{r read in data}
ld1 <- readRDS("data/df_clean.rds")
ld2 <- readRDS("data/df_followup_clean.rds")
ld3 <- readRDS("data/df_followup2_clean.rds")

#Pre-treatment partisanship
ld1$party <- ld1$pre_party_3
ld2$party <- ld2$pre_party_3
ld3$party <- ld3$pre_party_3

#Pre-treatment co-partisanship
ld1$partisan <- ld1$pre_partisan
ld2$partisan_1 <- ld2$pre_partisan_1
ld2$partisan_2 <- ld2$pre_partisan_2

```


####Figure 1: Study 1 Design
No code required, visual representation of Study 1 randomization, treatments, and outcomes


####Figure 2: Liar's Dividend Results for Study 1
```{r}
ld1$treatment <- if_else(ld1$alleg_treatment == "Info. Uncertain" | ld1$alleg_treatment == "Opp. Rally", 1, 0)

#Figure
ld_support <- lm_robust(data = ld1, 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
ld_support

mechs_support <- lm_robust(data = ld1, 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
mechs_support

ld_support_text <- lm_robust(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
ld_support_text

mechs_support_text <- lm_robust(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
mechs_support_text

ld_support_video <- lm_robust(data = ld1 %>% filter(media_format == "Video"), 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
ld_support_video

mechs_support_video <- lm_robust(data = ld1 %>% filter(media_format == "Video"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
mechs_support_video

study_1_support <- rbind(ld_support[2,], ld_support_text[2,], ld_support_video[2,], mechs_support[2,], mechs_support_text[2,], mechs_support_video[2,], mechs_support[3,], mechs_support_text[3,], mechs_support_video[3,])
study_1_support
study_1_support$model <- rep(c("Text and Video", "Text Only", "Video Only"), 3)
study_1_support$term <- rep(c("Allegation", "Info. Uncertain", "Opp. Rally"), each = 3)


study_1_support_plot <- dwplot(study_1_support %>% arrange(model),
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2),
dot_args = list(aes(shape = model), size = 1.5)) +
#whisker_args = list(color = "blue"))  +
scale_color_discrete(name = "Media Format", labels = c("Text and Video", "Text Only", "Video Only") %>% rev(), 
                      breaks=c("Text and Video", "Text Only", "Video Only") %>% rev()) +
 scale_shape_discrete(name = "Media Format", labels = c("Text and Video", "Text Only", "Video Only"), 
                      breaks=c("Text and Video", "Text Only", "Video Only")) +
    xlab("\nTreatment Effect (Standardized)") + ylab("") + ggtitle("Effects on Politician Support Index") +
    xlim(-.33, .33) +
    theme_bw() + 
    theme(plot.title = element_text(face="bold"),
          legend.position = "right",
          legend.background = element_rect(colour="grey80")
          )
study_1_support_plot

#Table
m1 <- lm(data = ld1, 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m2 <- lm(data = ld1, 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) 
m3 <- lm(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) 
m4 <- lm(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m5 <- lm(data = ld1 %>% filter(media_format == "Video"), 
                   support ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m6 <- lm(data = ld1 %>% filter(media_format == "Video"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)

stargazer(m1, m2, m3, m4, m5, m6,
          se = starprep(m1, m2, m3, m4, m5, m6),
          covariate.labels=c("Allegation", "Info. Uncertain", "Opp. Rally", 
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican", 
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels = "Politician Support Index",
          keep.stat = c("n","rsq"),
          title="Figure 2 Regression Results",
          label="tab:fig_2",
          star.char = c("+","*","**","***"), 
          star.cutoffs = c(0.1,0.05,0.01,0.001), 
          notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
          notes.append = F,
          add.lines = list(c("Sample", "Study 1", "Study 1", "Study 1 Text", "Study 1 Text", "Study 1 Video", "Study 1 Video")),
          style="APSR",
          header=F,
          type="latex",
          font.size="scriptsize")

```


####Figure 3: Liar's Dividend Results for Study 2
```{r}
#Figure
mechs_support_text <- lm_robust(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
mechs_support_text

IU_support <- lm_robust(data = ld2, 
                   support_exp1 ~ alleg_treatment_1 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
IU_support

ates <- c(mechs_support_text[2,2], IU_support[2,2]) %>% unlist %>% unname
ses <- c(mechs_support_text[2,3], IU_support[2,3]) %>% unlist %>% unname
ns <- c(nrow(ld1), nrow(ld2))
support_IU <- cbind(ates, ses, ns) %>% as_tibble()
support_IU_meta <- metagen(data = support_IU, TE = ates, seTE = ses, n.e = ns)
pooled_support_IU <- c("Pooled IU", support_IU_meta$TE.fixed, support_IU_meta$seTE.fixed, support_IU_meta$statistic.fixed, support_IU_meta$pval.fixed, support_IU_meta$TE.fixed - 1.96*support_IU_meta$seTE.fixed,
                       support_IU_meta$TE.fixed + 1.96*support_IU_meta$seTE.fixed)


OR_support <- lm_robust(data = ld2, 
                   support_exp2 ~ alleg_treatment_2 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
OR_support

ates <- c(mechs_support_text[3,2], OR_support[2,2]) %>% unlist %>% unname
ses <- c(mechs_support_text[3,3], OR_support[2,3]) %>% unlist %>% unname
ns <- c(nrow(ld1), nrow(ld2))
support_OR <- cbind(ates, ses, ns) %>% as_tibble()
support_OR_meta <- metagen(data = support_OR, TE = ates, seTE = ses, n.e = ns)
pooled_support_OR <- c("Pooled OR", support_OR_meta$TE.fixed, support_OR_meta$seTE.fixed, support_OR_meta$statistic.fixed, support_OR_meta$pval.fixed, support_OR_meta$TE.fixed - 1.96*support_OR_meta$seTE.fixed,
                       support_OR_meta$TE.fixed + 1.96*support_OR_meta$seTE.fixed)


study_2_support <- rbind(mechs_support_text[2,], IU_support[2,], pooled_support_IU, 
                         mechs_support_text[3,], OR_support[2,], pooled_support_OR)
study_2_support[,-1] <- sapply(study_2_support[,-1], as.numeric)
study_2_support
study_2_support$model <- factor(rep(c("Study 1", "Study 2", "Pooled"), 2), levels = c("Study 1", "Study 2", "Pooled"))
study_2_support$term <- rep(c("Info. Uncertain", "Opp. Rally"), each = 3)


study_2_support_plot <- dwplot(study_2_support %>% arrange(model),
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2),
dot_args = list(aes(shape = model, color = model), size = 1.5)) +
#whisker_args = list(color = "blue"))  +
scale_color_manual(name = "Study", labels = c("Study 1", "Study 2", "Pooled") %>% rev(),
                   breaks=c("Study 1", "Study 2", "Pooled") %>% rev(), 
                   values = c("#7570B3", "#D95F02", "#1B9E77")) + 
 scale_shape_discrete(name = "Study", labels=c("Study 1", "Study 2", "Pooled"),
                      breaks=c("Study 1", "Study 2", "Pooled")) +
    xlab("\nTreatment Effect (Standardized)") + ylab("") + ggtitle("Effects on Politician Support Index") +
    xlim(-.33, .33) +
    theme_bw() + 
    theme(plot.title = element_text(face="bold"),
          legend.position = "right",
          legend.background = element_rect(colour="grey80")
          )
study_2_support_plot


#Table
m1 <- lm(data = ld1 %>% filter(media_format == "Text"), 
                   support ~ alleg_treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m2 <- lm(data = ld2, 
                   support_exp1 ~ alleg_treatment_1 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m3 <- lm(data = ld2, 
                   support_exp2 ~ alleg_treatment_2 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)

stargazer(m1, m2, m3,
          se = starprep(m1, m2, m3),
          omit = c("Fact Check"),
          covariate.labels=c("Info. Uncertain", "Opp. Rally", "Info. Uncertain", "Opp. Rally",
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican",
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels.include = F,
          column.labels = c("Politician Support Index"),
          column.separate = c(3),
          keep.stat = c("n","rsq"),
          title="Figure 3 Regression Results",
          label="tab:fig_3",
          font.size="scriptsize",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
				  add.lines = list(c("Sample", "Study 1 Text", "Study 2", "Study 2")),
          style="APSR",
          header=F,
          type="latex")

```


####Figure 4: Heterogeneous Effects of Oppositional Rallying and Informational Uncertainty
```{r}
#IU pooled
ld3_IU <- ld1 %>% filter(alleg_treatment != "Opp. Rally") %>% 
  mutate(wave = 1) %>% 
  dplyr::select(support, belief, trust, belief_1,
                media_format, wave, alleg_treatment, partisan,
                party, gender, race, age, education, income, region, media_literacy, digital_literacy) %>% 
  rbind(
    ld2 %>% filter(alleg_treatment_1 != "Fact Check") %>% 
      mutate(media_format = "Text") %>% 
        mutate(wave = 2) %>% 
      dplyr::select(support = support_exp1, belief = belief_exp1, trust = trust_exp1, belief_1,
                    media_format, wave, alleg_treatment = alleg_treatment_1, partisan = partisan_1,
                    party, gender, race, age, education, income, region, media_literacy, digital_literacy))

#OR pooled
ld3_OR <- ld1 %>% filter(alleg_treatment != "Info. Uncertain") %>% 
  mutate(wave = 1) %>% 
  dplyr::select(support, #belief, trust,
                media_format, wave, alleg_treatment, partisan,
                party, gender, race, age, education, income, region, media_literacy, digital_literacy) %>% 
  rbind(
    ld2 %>% 
      mutate(media_format = "Text") %>% 
        mutate(wave = 2) %>% 
      dplyr::select(support = support_exp2, #belief = belief_exp1, trust = trust_exp1,
                    media_format, wave, alleg_treatment = alleg_treatment_2, partisan = partisan_2,
                    party, gender, race, age, education, income, region, media_literacy, digital_literacy))

#Interact with co-partisan variable
iu_anti <- lm_robust(data = ld3_IU %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=1) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_anti <- iu_anti[2,]

or_anti <- lm_robust(data = ld3_OR %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=1) + wave +
                        gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
or_anti <- or_anti[2,]

iu_mod <- lm_robust(data = ld3_IU %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=2) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_mod <- iu_mod[2,]

or_mod <- lm_robust(data = ld3_OR %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=2) + wave +
                        gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
or_mod <- or_mod[2,]

iu_co <- lm_robust(data = ld3_IU %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=3) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_co <- iu_co[2,]

or_co <- lm_robust(data = ld3_OR %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=3) + wave +
                        gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
or_co <- or_co[2,]

co_data <- rbind(iu_co, or_co, iu_mod, or_mod, iu_anti, or_anti)
co_data$model <- c("Co-partisan", "Co-partisan", "Independent", "Independent", "Out-partisan", "Out-partisan")
co_data$model <- factor(co_data$model, levels = c("Out-partisan","Independent","Co-partisan"))
co_data$term <- rep(c("Info. Uncertain", "Opp. Rally"), 3)

#Create coefficient plot for heterogeneous effects by partisanship
co_plot <- dwplot(co_data %>% arrange(desc(model)),
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2),
dot_args = list(size = 3, aes(color = model, shape = model)),
whisker_args = list(aes(color = model)))  +
  labs(color = "Partisanship", shape = "Partisanship") +
  guides(color = guide_legend(reverse = T), shape = guide_legend(reverse = T)) +
    xlab("\nTreatment Effect (Standardized)") + ylab("") + ggtitle("Effects on Politician Support Index by Co-partisanship") +
    xlim(-.25, .4) +
    theme_bw() + 
    theme(plot.title = element_text(face="bold"),
          legend.background = element_rect(colour="grey80"),
          axis.title.x = element_text(size = 11), axis.text.y = element_text(size = 9),
          legend.text = element_text(size = 10), legend.title = element_text(size = 10)
          )
co_plot

#Table
IU_fig4 <- lm(data = ld3_IU %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=2) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy)
OR_fig4 <- lm(data = ld3_OR %>% filter(media_format == "Text"),
                       support ~ alleg_treatment*relevel(factor(partisan), ref=2) + wave +
                         gender + race + age + education + income + region + media_literacy + digital_literacy)

stargazer(IU_fig4, OR_fig4,
          se = starprep(IU_fig4, OR_fig4),
          covariate.labels=c("Info. Uncertain", "Opp. Rally", "Anti-partisan", "Co-partisan",
                             "Wave",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Info. Uncertain x Anti-partisan", "Info. Uncertain x Co-partisan",
                             "Opp. Rally x Anti-partisan", "Opp. Rally x Co-partisan",
                             "Constant"),
          dep.var.labels = "Politician Support Index",
          keep.stat = c("n","rsq"),
          title="Figure 4 Regression Results",
          label="tab:fig_4",
          font.size="scriptsize",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
				  add.lines = list(c("Sample", "Studies 1 and 2", "Studies 1 and 2")),
          style="APSR",
          header=F,
          type="latex")
```


####Table 1: Impacts on Trust in Media
```{r}
ld_trust_text <- lm(data = ld1 %>% filter(media_format == "Text"), 
                   trust ~ treatment +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
ld_trust_text

IU_trust <- lm(data = ld2, 
                   trust_exp1 ~ alleg_treatment_1 +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
IU_trust


#Create regression table
stargazer(ld_trust_text, IU_trust, 
          se = starprep(ld_trust_text, IU_trust),
          keep = c("\\btreatment\\b", "alleg_treatment_1Info. Uncertain"),
          covariate.labels=c("Allegation", "Info. Uncertainty"),
          dep.var.labels.include = F,
				  column.labels = c("Trust in Media Index"),
          column.separate = c(2),
          keep.stat = c("n","rsq"),
          title="Impacts on Trust in Media",
          label="tab:trust_table",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 1 Text", "Study 2")),
          header=F,
          type="latex")

#Create full regression table
stargazer(ld_trust_text, IU_trust, 
          se = starprep(ld_trust_text, IU_trust),
          omit = c("Fact Check"),
          covariate.labels=c("Allegation", "Info. Uncertain",
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican",
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels.include = F,
          column.labels = c("Trust in Media Index"),
          column.separate = c(2),
          keep.stat = c("n","rsq"),
          title="Table 1 Full Regression Results",
          label="tab:table_1",
          font.size = "scriptsize",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 1 Text", "Study 2")),
          header=F,
          type="latex")
          
```


####Figure 5: Liar's Dividend Results for Study 3
```{r fig 5}
iu_v_denial <- lm_robust(data = ld3,
                   support ~ relevel(alleg_treatment, ref="Simple Denial") +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_v_denial <- iu_v_denial[2,]

iu_v_apology <- lm_robust(data = ld3,
                   support ~ relevel(alleg_treatment, ref="Apology") +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy) %>% tidy
iu_v_apology <- iu_v_apology[2,]

data <- rbind(iu_v_denial, iu_v_apology)
data$term <- c("Allegation of Misinformation \n (Info. Uncertain) \n vs. Denial", "Allegation of Misinformation \n (Info. Uncertain) \n vs. Apology")
data$term <- factor(data$term, levels = c("Allegation of Misinformation \n (Info. Uncertain) \n vs. Denial", "Allegation of Misinformation \n (Info. Uncertain) \n vs. Apology"))

#Create coefficient plot
followup_2_plot <- dwplot(data %>% arrange(desc(term)),
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2),
dot_args = list(size = 3, color = "blue"),
whisker_args = list(color = "blue"))  +
#scale_color_discrete(name = "Outcome", breaks=c("Feeling", "Trust", "Quality", "Impact")) +
 # scale_shape_discrete(name = "Outcome", breaks=c("Feeling", "Trust", "Quality", "Impact")) +
    xlab("\nTreatment Effect (Standardized)") + ylab("") + ggtitle("Effects on Politician Support Index") +
    xlim(-.3, .3) +
    theme_bw() + 
    theme(plot.title = element_text(face="bold"),
          legend.position = "none",
          legend.background = element_rect(colour="grey80"),
            axis.text = element_text(size = 12)
          )
followup_2_plot

#Table
iu_v_other <- lm(data = ld3,
                   support ~ relevel(alleg_treatment, ref="Info. Uncertain") +
                     party + gender + race + age + education + income + region + media_literacy + digital_literacy)
stargazer(iu_v_other, 
          se = starprep(iu_v_other),
          covariate.labels=c("Denial vs. IU", "Apology vs. IU",
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican",
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels = "Politician Support Index",
          keep.stat = c("n","rsq"),
          title="Figure 5 Regression Results",
          label="tab:fig_5",
          font.size="scriptsize",
				  star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
				  notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 3")),
          header=F,
          type="latex")
```


####Table 2: Allegations of Misinformation Versus Apologies
```{r table 2}
#IU versus apology
ld3$alleg_treatment_3 <- factor(ld3$alleg_treatment, levels = c("Apology","Info. Uncertain", "Simple Denial"))

#Do the allegation treatments affect politician support?
hyp_1_combined_support <- lm(data = ld3 %>% filter(alleg_treatment_3 != "Simple Denial"), 
                             support ~ alleg_treatment_3 +
                               party + gender + race + age + education + income + region + media_literacy + digital_literacy)
hyp_1_combined_support %>% summary


#Do the allegation treatments affect belief in the story?
hyp_1_combined_belief <- lm(data = ld3 %>% filter(alleg_treatment_3 != "Simple Denial"), 
                             belief ~ alleg_treatment_3 +
                              party + gender + race + age + education + income + region + media_literacy + digital_literacy)
hyp_1_combined_belief %>% summary


#Do the allegation treatments affect trust in media?
hyp_1_combined_trust <- lm(data = ld3 %>% filter(alleg_treatment_3 != "Simple Denial"), 
                             trust ~ alleg_treatment_3 +
                             party + gender + race + age + education + income + region + media_literacy + digital_literacy)
hyp_1_combined_trust %>% summary

#Create regression table
stargazer(hyp_1_combined_support, hyp_1_combined_belief, hyp_1_combined_trust, 
          se = starprep(hyp_1_combined_support, hyp_1_combined_belief, hyp_1_combined_trust),
          keep = c("alleg_treatment_3Info. Uncertain"),
          covariate.labels=c("Info. Uncertain"),
          dep.var.labels = c("Support Index", "Belief Index", "Trust Index"),
          keep.stat = c("n","rsq"),
          title="Allegations of Misinformation versus Apologies",
          label="tab:combined",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
          notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 3", "Study 3", "Study 3")),
          header=F,
          type="latex")

#Create full regression table
stargazer(hyp_1_combined_support, hyp_1_combined_belief, hyp_1_combined_trust, 
          se = starprep(hyp_1_combined_support, hyp_1_combined_belief, hyp_1_combined_trust),
          covariate.labels=c("Info. Uncertain",
                             "Strong Democrat", "Democrat", "Lean Democrat", "Lean Republican", "Republican",
                             "Strong Republican",
                             "Female",
                             "Black", "Other Race",
                             "Millennial", "Gen X", "Boomer", "Silent Gen.",
                             "Some College", "Bachelor's Degree", "Graduate Degree",
                             "Low Income", "High Income",
                             "Midwest", "South", "West",
                             "Media Literacy",
                             "Digital Literacy",
                             "Constant"),
          dep.var.labels = c("Support Index", "Belief Index", "Trust Index"),
          keep.stat = c("n","rsq"),
          title="Table 2 Full Regression Results",
          label="tab:table_2",
          font.size="scriptsize",
          star.char = c("+","*","**","***"), 
				  star.cutoffs = c(0.1,0.05,0.01,0.001), 
				  notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
          notes.append = F,
          style="APSR",
				  add.lines = list(c("Sample", "Study 3", "Study 3", "Study 3")),
          header=F,
          type="latex")
```

